﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LogicExpressionCalculator
{
    public class LogicConstOperand : LogicOperand
    {
        #region Properties
        public static LogicConstOperand TrueOperand = new LogicConstOperand(true);
        public static LogicConstOperand FalseOperand = new LogicConstOperand(false);

        public override string Identify
        {
            get
            {
                return base.Identify;
            }
        }

        /// <summary>
        /// Cannot set the value
        /// </summary>
        public override bool Value
        {
            get
            {
                return base.Value;
            }
            set
            {
                throw new Exception("Cannot set the value since it is a constant value.");
            }
        }
        #endregion

        #region Constructor
        /// <summary>
        /// 
        /// </summary>
        /// <param name="value"></param>
        private LogicConstOperand(bool value) : base("ConstOperand")
        {
            _value = value;
        }
        #endregion

        public override string ToString()
        {
            return _value.ToString();
        }
    }
}
